<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>jQuery&&Ajax方式.html</title>
    <script src="js/jquery-3.4.1.min.js"></script>
</head>
<body>
<div id="myDiv"><h2>使用 AJAX 修改该文本内容</h2></div>
<button type="button" onclick="getData()">修改内容</button>

<script>
    function getData(){
        $.ajax({
           url:'abc.txt',
           type:'get',
           data:'',
           success(data){
               console.log('123');
               $("#myDiv").html(data);
           },
            error(err){
               console.log('456');0
            }
        });
    }
</script>
</body>
</html>